#include "test_config_Den_Lib.h"

#ifdef TEST_DENIS_TFUNCTRAITS

#include "Den_Lib/Den_TFuncTraits.h"

#define Gen_CHECK const size_t val = Ty::eIS_FREE + Ty::eIS_METHOD + Ty::eIS_CONST + Ty::eIS_VOLATILE + Ty::eIS_ELIPSE; const size_t args = Ty::eNUM_OF_ARG;

namespace
{
    struct ForTest;
}

TEST(TFuncTraits_test, 000)
{
    typedef TFuncTraits<void(*)()> Ty; Ty test; Gen_CHECK;  EXPECT_EQ(0, args); EXPECT_EQ(1, val);
}
TEST(TFuncTraits_test, 001)
{
    typedef TFuncTraits<void(*)(void)> Ty; Ty test; Gen_CHECK; EXPECT_EQ(0, args); EXPECT_EQ(1, val);
}
TEST(TFuncTraits_test, 002)
{
    typedef TFuncTraits<int(*)(int)> Ty;  Ty test; Gen_CHECK; EXPECT_EQ(1, args); EXPECT_EQ(1, val);
}

TEST(TFuncTraits_test, 003)
{
    typedef TFuncTraits<void(*)(...)> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(2, val); EXPECT_EQ(1, Ty::eIS_ELIPSE);
}
TEST(TFuncTraits_test, 004)
{
    typedef TFuncTraits<void(*)(int,int,...)> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(2, args); EXPECT_EQ(2, val);EXPECT_EQ(1, Ty::eIS_ELIPSE);
}
TEST(TFuncTraits_test, 005)
{
    typedef TFuncTraits<int(*)(int,...)> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(2, val); EXPECT_EQ(1, Ty::eIS_ELIPSE);
}

TEST(TFuncTraits_test, 006)
{
    typedef TFuncTraits<void(ForTest::*)()> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(1, val); EXPECT_EQ(1, Ty::eIS_METHOD);
}

TEST(TFuncTraits_test, 007)
{
    typedef TFuncTraits<void(ForTest::*)()const> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(2, val); EXPECT_EQ(1, Ty::eIS_METHOD); EXPECT_EQ(1, Ty::eIS_CONST);
}
TEST(TFuncTraits_test, 008)
{
    typedef TFuncTraits<void(ForTest::*)(int)const> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(2, val); EXPECT_EQ(1, Ty::eIS_METHOD); EXPECT_EQ(1, Ty::eIS_CONST);
}

TEST(TFuncTraits_test, 009)
{
    typedef TFuncTraits<void(ForTest::*)()volatile> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(2, val); EXPECT_EQ(1, Ty::eIS_METHOD); EXPECT_EQ(1, Ty::eIS_VOLATILE);
}
TEST(TFuncTraits_test, 010)
{
    typedef TFuncTraits<void(ForTest::*)(int)volatile> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(2, val); EXPECT_EQ(1, Ty::eIS_METHOD); EXPECT_EQ(1, Ty::eIS_VOLATILE);
}

TEST(TFuncTraits_test, 011)
{
    typedef TFuncTraits<void(ForTest::*)()const volatile> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(3, val); EXPECT_EQ(1, Ty::eIS_METHOD); 
    EXPECT_EQ(1, Ty::eIS_VOLATILE); EXPECT_EQ(1, Ty::eIS_CONST);
}
TEST(TFuncTraits_test, 012)
{
    typedef TFuncTraits<void(ForTest::*)(int)const volatile> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(3, val); EXPECT_EQ(1, Ty::eIS_METHOD); 
    EXPECT_EQ(1, Ty::eIS_VOLATILE); EXPECT_EQ(1, Ty::eIS_CONST);
}

TEST(TFuncTraits_test, 013)
{
    typedef TFuncTraits<void(ForTest::*)(...)> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(2, val); EXPECT_EQ(1, Ty::eIS_METHOD);  EXPECT_EQ(1, Ty::eIS_ELIPSE); 
}
TEST(TFuncTraits_test, 014)
{
    typedef TFuncTraits<void(ForTest::*)(int,...)> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(2, val); EXPECT_EQ(1, Ty::eIS_METHOD);  EXPECT_EQ(1, Ty::eIS_ELIPSE); 
}

TEST(TFuncTraits_test, 015)
{
    typedef TFuncTraits<void(ForTest::*)(...)const> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(3, val); EXPECT_EQ(1, Ty::eIS_METHOD); 
    EXPECT_EQ(1, Ty::eIS_ELIPSE); EXPECT_EQ(1, Ty::eIS_CONST);
}
TEST(TFuncTraits_test, 016)
{
    typedef TFuncTraits<void(ForTest::*)(int,...)const> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(3, val); EXPECT_EQ(1, Ty::eIS_METHOD);  
    EXPECT_EQ(1, Ty::eIS_ELIPSE); EXPECT_EQ(1, Ty::eIS_CONST);
}

TEST(TFuncTraits_test, 017)
{
    typedef TFuncTraits<void(ForTest::*)(...)const volatile> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(4, val); EXPECT_EQ(1, Ty::eIS_METHOD); 
    EXPECT_EQ(1, Ty::eIS_ELIPSE); EXPECT_EQ(1, Ty::eIS_CONST); EXPECT_EQ(1, Ty::eIS_VOLATILE);
}
TEST(TFuncTraits_test, 018)
{
    typedef TFuncTraits<void(ForTest::*)(int,...)const volatile> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(4, val); EXPECT_EQ(1, Ty::eIS_METHOD);  
    EXPECT_EQ(1, Ty::eIS_ELIPSE); EXPECT_EQ(1, Ty::eIS_CONST); EXPECT_EQ(1, Ty::eIS_VOLATILE);
}

TEST(TFuncTraits_test, 019)
{
    typedef TFuncTraits<void(ForTest::*)(...)volatile> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(0, args); EXPECT_EQ(3, val); EXPECT_EQ(1, Ty::eIS_METHOD); 
    EXPECT_EQ(1, Ty::eIS_ELIPSE); EXPECT_EQ(1, Ty::eIS_VOLATILE);
}
TEST(TFuncTraits_test, 020)
{
    typedef TFuncTraits<void(ForTest::*)(int,...)volatile> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(3, val); EXPECT_EQ(1, Ty::eIS_METHOD);  
    EXPECT_EQ(1, Ty::eIS_ELIPSE); EXPECT_EQ(1, Ty::eIS_VOLATILE);
}

TEST(TFuncTraits_test, 021)
{
    typedef TFuncTraits<void(ForTest::*)(int,...)volatile const> Ty;  Ty test; Gen_CHECK; 
    EXPECT_EQ(1, args); EXPECT_EQ(4, val); EXPECT_EQ(1, Ty::eIS_METHOD);  
    EXPECT_EQ(1, Ty::eIS_ELIPSE); EXPECT_EQ(1, Ty::eIS_CONST); EXPECT_EQ(1, Ty::eIS_VOLATILE);
}


#undef Gen_CHECK

#endif //TEST_DENIS_TFUNCTRAITS